package com.probox.common.entity.mapper.customer;

import com.probox.common.entity.domain.customer.CustomerLevelInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.probox.customer.api.domain.CustomerLevel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 客户信息、等级关系映射Mapper接口
 *
 * @author zsy
 * @date 2021-05-27
 */
public interface CustomerLevelInfoMapper extends BaseMapper<CustomerLevelInfo> {

    CustomerLevel getLevelByUid(@Param("customerUid") Long customerUid);

    /**
     * 根据客户查询等级
     *
     * @param customerUid
     * @return
     */
    CustomerLevelInfo getLevel(@Param("customerUid") Long customerUid);

    /**
     * 根据用户id查询对应的等级名称
     *
     * @param customerUid
     * @return
     */
    String getLevelNameByUid(@Param("customerUid") Long customerUid);


    public CustomerLevelInfo selectNewCustomerLevelInfo(Long customerUid);

    List<CustomerLevelInfo> selectLevelInfoList(@Param("customerUid") Long customerUid, @Param("status") String status);

    /**
     * 根据会员等级查询会员ID
     * @param levels
     * @return
     */
    List<Long> selectCustomerByLevel(@Param("levels") List<Long> levels);
}
